package cn.hsw.component.auth.exception;


import cn.hsw.component.core.enums.HttpEnum;

/**
 * 权限异常
 * @author 李子木
 * @date 2020-11-06
 */
public class CheckPermissionException extends RuntimeException {
    private static final long serialVersionUID = 4607916398267818509L;

    private int code;

    public CheckPermissionException(){
        super(HttpEnum.UNAUTHORIZED.getMsg());
        this.code = this.code = HttpEnum.UNAUTHORIZED.getCode();
    }

    public CheckPermissionException(String message) {
        super(HttpEnum.UNAUTHORIZED.getMsg()+","+message);
        this.code = HttpEnum.UNAUTHORIZED.getCode();
    }

    public CheckPermissionException(int code, String message) {
        super(message);
        this.code = code;
    }

    public int getCode(){
        return this.code;
    }
}
